<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>添加项目联系记录</title>
<meta name="decorator" content="default" />
<script type="text/javascript">
	$(function() {
		$("#address").val("");
		$("#contactId").val("");
		$("#proStatus").val("");
		$("#content").val("");
		var validate = $("#inputForm").validate({
			debug:true,
			focusInvalid:false,
			submitHandler:function(form){
				loading('正在提交，请稍等...');
			    form.submit();	
			},
			rules:{
				address:{
					required:true
				},
				contactId:{
					required:true
				},
				proStatus:{
					required:true
				},
				content:{
					required:true
				}				
			},
			messages:{
				address:{
					required:"必填"
				},
				contactId:{
					required:"必选"
				},
				proStatus:{
					required:"必选"
				},
				content:{
					required:"必填"
				}				
			}
		})
	});
</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active">
			<a href="javascript:void(0)">添加联系记录</a>
		</li>
	</ul>
	<br />
	<form:form id="inputForm" modelAttribute="projectContact" action="${ctx}/crm/project/projectcontact/addProjectContact" method="post" class="form-horizontal">
		<form:input type="hidden" path="createId" value="${project.createid}" />
		<form:input type="hidden" path="projectId" value="${project.id}" />
		<div class="control-group">
			<label class="control-label">地点:</label>
			<div class="controls">
				<form:input id="address" name="address" path="address" type="text" style="width:300px;" maxlength="100" class="required" />
				<span class="help-inline">
					<font color="red"></font>
				</span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">联系人:</label>
			<div class="controls">
				<form:select style="width: 300px;" id="contactId" path="contactId" class="required">
					<option value="">请选择</option>
					<c:forEach items="${contact}" var="contact">
						<form:option value="${contact.id}">${contact.name}</form:option>
					</c:forEach>
				</form:select>
				<span class="help-inline">
					<font color="red"></font>
				</span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">状态:</label>
			<div class="controls">
				<form:select cssClass="input-xlarge" style="width: 300px;" id="proStatus" path="proStatus" class="required">
					<option value="">请选择</option>
					<c:forEach items="${dict}" var="dict">
						<form:option value="${dict.id}">${dict.label}</form:option>
					</c:forEach>
				</form:select>
				<span class="help-inline">
					<font color="red"></font>
				</span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">内容：</label>
			<div class="controls">
				<form:textarea id="content" path="content" style="width:600px;height:150px;" maxlength="500" class="required"></form:textarea>
				<span class="help-inline">
					<font color="red"></font>
				</span>
			</div>
		</div>
		<div class="form-actions">
			<input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存" />
			<input id="btnCancel" class="btn btn-primary" type="button" value="返 回" onclick="history.go(-1)" />
		</div>
	</form:form>
</body>
</html>